#include <stdio.h>
int main()
{
	int n, m,k,count,flag;
	count = 0;
	scanf("%d %d", &m, &n);
	for (k =m; k <= n; k++)
	{
		if (k <= 1) {
			flag = 0;
		}
		else if (k == 2) {
			flag = 1;
		}
		else
		{
			flag = 1;
			for (int i = 2; i < k; i++)
			{
				if (k % i == 0)
				{
					flag = 0;
					break;
				}
			}
		}
		if (flag == 1)
		{
			printf("%d", k);
	
			count++;
			if (count % 10 == 0)
			{
				printf("\n");
			}
		}
	}
	return 0;
}
